<%@page import="org.upt.dcda.db.AuthorEntity"%>
<%@page import="org.upt.dcda.db.BookEntity"%>
<%@ taglib prefix="stripes"
	uri="http://stripes.sourceforge.net/stripes.tld"%>
<stripes:layout-render name="layout/default.jsp"
	pageTitle="Using A Layout">
	
	<stripes:layout-component name="pageTitle">
	Author
 	</stripes:layout-component>
 	
 	<stripes:layout-component name="html_head">
 	<script type="text/javascript">
	
	function getAuthorInfo(id)
	{
		$.getJSON("services/authors/getInfo?id=" + id, function(data) {
				$('#authorInfo > tbody:last').append(
						'<tr>' + 
						'<td>' + data.name + '</td>' + 
						'<td>' + data.info + '</td>' + 
						'</tr>');
		});
		
	}
	
	$(document).ready(function() 
	{
		getAuthorInfo(<%= request.getParameter("id") %>);
	});
	</script>
 	 </stripes:layout-component>
 	 
 	 <stripes:layout-component name="contents">
 	 <table id="authorInfo">
	<tbody>
		<tr>
			<th>Name</th>
			<th>Info</th>
		</tr>
	</tbody>
</table>
 	 </stripes:layout-component>
	
</stripes:layout-render>